<html>
<head lang="zh_cn">
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<input id="zhanghao"/>
<br>
<input id="mima"/>
<br>
<button id="denglu">登陆12</button>
</body>
</html>
<script type="text/javascript" src="jquery.min.js"></script>

<script>

    $("#denglu").click(function () {
        $.ajax({
            type: 'post',
            url: '/test/login',
            data:{'name':$("#zhanghao").val(),'pass':$("#mima").val()},
            success: function(data){
                data=JSON.parse(data);
                if (data.code =='1'){
                    alert("登陆成功")
                } else {
                    alert("登陆失败")
                }
            }
        });
    })


</script>
